#include "Command.hpp"



int main()
{

    key_t key = GetShmKey();
    
    //创建共享内存
    int shmid = CreateShm(key,defaultsize);
    cout<<shmid<<endl;

    //挂接到共享内存
    char* addr = (char*)AttachShm(shmid);
    cout << "Attach shm success, addr: " << ToHex((uint64_t)addr) << std::endl;

    // for(;;)
    // {
    //     cout<<addr<<endl;
    //     sleep(1);
        
    // }

    //断开挂接
    DetachShm(addr);
    cout << "Detach shm success, addr: " << ToHex((uint64_t)addr) << std::endl;

    //删除共享内存
    DeleteShm(shmid);

    return 0;
}